/*
 * Tileset.java
 *
 * Created on August 26, 2007, 5:07 PM
 *
 */

package org.eruta;
import java.awt.Image;

/**
 *
 * @author bjorn
 */
public class Tileset {
    
    static final int TILES_MAX_DEFAULT = 10000;    
    Tile _tiles[];
    int _tiles_max;
    int _tiles_now;
    
    /** Creates a new instance of Tileset */
    public Tileset(int max) {
        _tiles_max = max;
        _tiles_now = 0;
        _tiles = new Tile[_tiles_max];
    }
    
    public Tileset() {
        this(TILES_MAX_DEFAULT);
    }
    
    public boolean add(Tile tile) {
        if(_tiles_now >= _tiles_max ) return false;
        _tiles[_tiles_now] = tile;
        _tiles_now ++;
        return true;
    }
    
    public Image get(int tile_index) {
        return _tiles[tile_index].get();
    }
    
    
    
}
